<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人信息</title>
   
</head>

<body class="main-body">
    <main>
        <h1>个人信息</h1>
        <%
            if (request.getSession().getAttribute("userInfo") == null) {
                out.println("<p>用户信息获取失败，请检查网络或联系管理员。</p>");
            }
        %>
        <form action="updateUserInfo" method="post">
            <fieldset>
                <legend>用户基本信息</legend>
                <label for="username">用户名:</label>
                <input type="text" id="username" name="username" value="${userInfo.username}" readonly><br><br>

                <label for="password">密码:</label>
                <input type="text" id="password" name="password" value="${userInfo.password}" readonly><br><br>

                <label for="email">邮箱:</label>
                <input type="email" id="email" name="email" value="${userInfo.email}" readonly><br><br>

                <label for="registerTime">注册时间:</label>
                <input type="text" id="registerDate" name="registerDate" value="${userInfo.registerDate}" readonly><br><br>

                <label for="gender">性别:</label>
                <input type="text" id="gender" name="gender" value="${userInfo.gender}" readonly><br><br>

                <label for="memberLevel">会员等级:</label>
                <input type="text" id="memberLevel" name="memberLevel" value="${userInfo.memberLevel}" readonly><br><br>

                <label for="totalConsumption">总消费金额：</label>
                <input type="text" id="totalConsumption" name="totalConsumption" value="${userInfo.totalConsumption}" readonly><br><br>
            </fieldset>
        </form>

        <div class="button-container">
        <input type="submit" value="编辑个人信息" onclick="window.location.href='edituser.jsp'" />
        <input type="submit" value="返回首页" onclick="window.location.href='customer.jsp'" />
    </div>
    </main>
</body>
 <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
        }

        .main-body {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        form {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            width: 600px;
        }

        form label {
            display: inline-block;
            width: 120px;
            text-align: right;
            margin-right: 10px;
        }

        form input {
            display: inline-block;
            width: 250px;
        }

        form input:hover {
            border-color: #888;
        }

        form input:focus {
            outline: none;
            border-color: green;
            box-shadow: 0 0 3px rgba(0, 128, 0, 0.5);
        }

      
		input[type="submit"] {
		    background-color: green;
		    color: white;
		    border: none;
		    padding: 10px 20px;
		    border-radius: 4px;
		    cursor: pointer;
		    transition: background-color 0.3s ease;
		}

		input[type="submit"]:hover {
		    background-color: #008000;
		}

		.button-container {
		    display: flex;
		    justify-content: space-around; 
		    
		}

        main h1 {
            font-size: 24px;
            border-bottom: 1px solid #ccc;
            padding-bottom: 10px;
            margin-bottom: 20px;
        }

        legend {
            font-weight: bold;
            padding: 0 10px;
        }

    </style>
</html>